import store from 'admin/store'
import router from 'admin/router'

const state = {}
const mutations = {
    //统一修改state
    SET_STATE(state, param) {
        Object.assign(state, param)
    },
}

const actions = {
    // 全局应用配置
    async globalConfig({ rootGetters }, { vm }) {
        // 如果登录了
        if (rootGetters.token) {
            this.dispatch('permission/generateRoutes')
        }
    },
}

export default {
    namespaced: true,
    state,
    mutations,
    actions,
}
